$(function() {
	$('#login-form').submit(function() {
		var me = $(this);
		showWaitMask('正在验证...');
		me.ajaxSubmit({
			success : function(data) {
				showWaitMask('正在处理...');
				if (data.success) {
					if($.isFunction(window.rCallback)){
						$.ajax({
							url:window.rUrl,
							success:window.rCallback
						});
					}else{						
						window.location.href = window.rUrl;
					}
				} else {
					hideWaitMask();
					transitDialog(window.rTransit,window.rUrl,window.rCallback);
				}				
			}
		});
		return false;
	});
});

function doFileAuth(transit, url, callback) {
	window.rUrl = url;
	window.rCallback = callback;
	window.rTransit = transit;
	$('#login-form').submit();
}
